#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    resize(800,600);

   // EmitSignal();
    //QPushButton *btn=new QPushButton("学习",this);
    //this->teacher=new Teacher(this);
    //this->student=new Student(this);
     //connect(teacher,&Teacher::TeacherSignal,student,&Student::StayStudy);
     //connect(btn,&QPushButton::clicked,this,&Widget::EmitSignal);
//    void (Widget::*Signal_p)(QString)=&Widget::MySignal;
//    void (Widget::*Slot_p)()=&Widget::MySlot;
//    connect(this,Signal_p,this,Slot_p);
    connect(this,&Widget::MySignal,this,&Widget::MySlot_1);
    connect(this,&Widget::MySignal_1,this,&Widget::MySlot_1);
    connect(this,&Widget::MySignal_2,this,&Widget::MySlot_1);
    EmitSignal();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::EmitSignal()
{
    //qDebug()<<"已发射信号"<<endl;
    //emit teacher->TeacherSignal();
    emit MySignal();
    emit MySignal_1();
    emit MySignal_2();
}

void Widget::MySlot_1()
{
   qDebug()<<"MySlot_1();"<<endl;
}
void Widget::MySlot_2()
{
   qDebug()<<"MySlot_2();"<<endl;
}
void Widget::MySlot_3()
{
   qDebug()<<"MySlot_3();"<<endl;
}

//void Widget::MySlot()
//{
//   qDebug()<<"MySignal();"<<endl;

//  ui->setupUi(this);
//    //student->StayStudy();
//}

//void Widget::MySlot()
//{
//    qDebug()<<"你好";
//}


//void Widget::on_pushButton_clicked()
//{
//    this->close();
//}
